﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.ComponentModel;

namespace TravelWeb.Models
{
    [Bind(Exclude = "PromotionID")]
    public class Promotion
    {
        [ScaffoldColumn(false)]
        public int PromotionID { get; set; }
        [Required(ErrorMessage = "Promotion Name is required")]
        [DisplayName("Promotion Name")]
        [StringLength(160)]
        public String PromotionName { get; set; }
        [Required(ErrorMessage = "Promotion Type is required")]
        [DisplayName("Promotion Type")]
        [StringLength(160)]
        public String PromotionType { get; set; }
        [Range(0.00, 99.99, ErrorMessage = "Discount must between 0% and 99%")]
        public double DiscountPercent { get; set; }
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        public DateTime StartDate { get; set; }
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        public DateTime EndDate { get; set; }
        [ScaffoldColumn(false)]
        public String Status { get; set; }

        public List<Promotion> Promotions { get; set; }
    }
}